public class work_02 {
    public static void main(String[] args) {
        //静态初始化一维数组{10,20,11,35,6,89}，进行冒泡排序
        int[] arr = {10,20,11,35,6,89};
        for (int i = 0; i < arr.length; i++) {
            int temp;
            for (int j = 0; j < arr.length-i-1; j++) {
                if (arr[j]>arr[j+1]){
                    temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i] + " ");
        }
    }
}
